#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 2e3 + 10, M = N * 2;
int h[N], e[M], ne[M], idx;
int f[N][2];
int n, m;
int ans;
void add(int a, int b)
{
	e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
void dfs(int u, int fa)
{
	f[u][1] = 1;
	for (int i = h[u]; ~i; i = ne[i]) {
		int j = e[i];
		if (j == fa)continue;
		dfs(j, u);
		f[u][0] += f[j][1];
		f[u][1] += min(f[j][0], f[j][1]);
	}
}
int main()
{
	cin >> n;
	memset(h, -1, sizeof(h));
	for (int i = 1; i <= n; i++) {
		int root;
		cin >> root;
		root++;
		cin >> m;
		int son;
		while (m--) {
			cin >> son;
			son++;
			add(root, son);
			add(son, root);
		}
	}
	dfs(1, 0);
	cout << min(f[1][0], f[1][1]) << endl;
	//cout << ans << endl;
	return 0;
}